<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Update the RRD database file</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="rrdupdater.construct.html">« RRDUpdater::__construct</a></li>
      <li style="float: right;"><a href="book.scoutapm.html">ScoutAPM »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.rrdupdater.html">RRDUpdater</a></li>
    <li>Update the RRD database file</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="rrdupdater.update" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">RRDUpdater::update</h1>
  <p class="verinfo">(PECL rrd &gt;= 0.9.0)</p><p class="refpurpose"><span class="refname">RRDUpdater::update</span> &mdash; <span class="dc-title">Update the RRD database file</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-rrdupdater.update-description">
  <h3 class="title">说明</h3>
   <div class="methodsynopsis dc-description">
    <span class="modifier">public</span> <span class="methodname"><strong>RRDUpdater::update</strong></span>(<span class="methodparam"><span class="type">array</span> <code class="parameter">$values</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$time</code>
     <span class="initializer"> = time()</span>
    </span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Updates the RRD file defined via <span class="methodname"><a href="rrdupdater.construct.html" class="methodname">RRDUpdater::__construct()</a></span>.
   The file is updated with a specific values.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-rrdupdater.update-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">values</code></dt>

     <dd>

      <p class="para">
       Data for update. Key is data source name.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">time</code></dt>

     <dd>

      <p class="para">
       Time value for updating the RRD with a particular data. Default value
       is current time.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-rrdupdater.update-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>， 或者在失败时返回 <strong><code>false</code></strong>。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-rrdupdater.update-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   Throws a <span class="classname"><a href="class.exception.html" class="classname">Exception</a></span> on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-rrdupdater.update-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4455">
    <p><strong>示例 #1 <span class="methodname"><strong>RRDUpdater::update()</strong></span> examples</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$updator&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">RRDUpdater</span><span style="color: #007700">(</span><span style="color: #DD0000">"speed.rrd"</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">//updates&nbsp;the&nbsp;data&nbsp;source&nbsp;"speed"&nbsp;with&nbsp;value&nbsp;"12411"<br />//for&nbsp;time&nbsp;defined&nbsp;by&nbsp;timestamp&nbsp;"920807700"<br /></span><span style="color: #0000BB">$updator</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">update</span><span style="color: #007700">(array(</span><span style="color: #DD0000">"speed"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"12411"</span><span style="color: #007700">),&nbsp;</span><span style="color: #DD0000">"920807700"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

</div></div></div></body></html>